package cn.jwt.controller;


import cn.jwt.domain.ResponseResult;
import cn.jwt.entity.SysUser;
import cn.jwt.service.LoginServcie;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 用户表 前端控制器
 * </p>
 *
 * @author 廖柏曦
 * @since 2022-03-29
 */
@RestController
@RequestMapping("/sys-user")
@Api("用户表 前端控制器")
public class SysUserController {

    @Autowired
    private LoginServcie loginServcie;


    @PostMapping("/login")
    public ResponseResult login(@RequestBody SysUser sysUser){
        //登录
        return loginServcie.login(sysUser);
    }

    @RequestMapping("/logout")
    public ResponseResult logout(){
        return loginServcie.logout();
    }

}
